<?php
 session_start();
 require_once "src/conn.php";
  
 //generate non-repeating random numbers
 $vrint = 1; //counter variable
 $vrnumbers[0] = 0;
 while (count($vrnumbers) <= 10)
 {
  $vrrand = rand(1,52);
  while (in_array($vrrand, $vrnumbers)) //check if the random number already exist
  {
   $vrrand = rand(1,52);
  }
  $vrnumbers[$vrint] = $vrrand;
  //echo $vrint."-",$vrnumbers[$vrint],"<br />";
  $vrint++;
 }
 sort($vrnumbers);
 $_SESSION["questions"]["q"] = $vrnumbers;
 //print_r($_SESSION["questions"]['q']);
 //echo $_SESSION["questions"]['q'][1];
?>
 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
 <html>
  <head>
   <title>Quiz</title>
   <script language="javascript" type="text/javascript" src="src/script.js"></script>
   <script language="javascript" type="text/javascript">
   function getradio(form,elements)
   {
    for (var i=0; i < form.elements.length; i++)
    {
     if (form.elements[i].checked)
     {
      return form.elements[i].value;
     }
    }
   }
   function toggle(control, content) {
    var vrcontent = document.getElementById(content);
    var vrcontrol = document.getElementById(control);
    if (vrcontent.style.display == "block") {
     vrcontent.style.display = "none";
     vrcontrol.innerHTML = "pergunta";
    }
    else {
     vrcontent.style.display = "block";
     vrcontrol.innerHTML = "ocultar";     
    }
   }
   </script>
  </head>

  <body>
   <div id="divpanel">
    <a href="javascript:loadXML('divpanel','src/p_form.php?','vrnum=1')">PHP I</a><br />
   </div>
  </body>

 </html>
